<div class="col-sm-12 mt20">

    <div class="panel panel-default">
        <div class="panel-body" ng-keyup="myKeyup($event)">
            <div class="col-xs-12 row">
                <div class="col-sm-2">
                    <input type="text" class="form-control" ng-model="searchform.goods_name" placeholder="商品名称"/>
                </div>
                <div class="col-sm-2">
                    <ui-select ng-model="searchform._user" theme="bootstrap">
                        <ui-select-match placeholder="选择下单账号...">{{$select.selected.name}}
                            <span ng-if="$select.selected.login_name">【{{$select.selected.login_name}}】</span>
                        </ui-select-match>
                        <ui-select-choices repeat="item in accountList">
                            <span ng-bind-html="item.name | highlight: $select.search"></span>
                            <span ng-if="item.login_name">
                                【
                                <span ng-bind-html="item.login_name | highlight: $select.search"></span>】
                            </span>
                        </ui-select-choices>
                    </ui-select>
                </div>
                <div class="col-sm-2">
                    <select name="goods_type" class="form-control" ng-model="searchform.goods_type">
                        <option value="">---商品类型---</option>
                        <option value="1">消费商品</option>
                        <option value="2">储值商品</option>
                    </select>
                </div>
                <div class="col-sm-2">
                    <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="period_start.value" is-open="period_start.opened"
                        ng-click="dateOpen($event, period_start)" placeholder="开始时间" ng-required="true" close-text="关闭" current-text="今天"
                        clear-text="清除" readonly/>
                </div>
                <div class="col-sm-2">
                    <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="period_end.value" is-open="period_end.opened"
                        ng-click="dateOpen($event, period_end)" placeholder="结束时间" ng-required="true" close-text="关闭" current-text="今天"
                        clear-text="清除" readonly/>
                </div>
                <div class="col-sm-2">
                    <button class="btn btn-info search btn-block" ng-click="loadlist()">立即搜索</button>
                </div>
            </div>
            <div class="col-xs-12 row mt20">
                <div class="col-sm-2"></div>
                <div class="col-sm-2"></div>
                <div class="col-sm-2"></div>
                <div class="col-sm-2"></div>
                <div class="col-sm-2"></div>
                <div class="col-sm-2">
                    <input type="button " class="btn btn-info search form-control" ng-click="exportToExcel('#Excel_table')" value="导出Excel">
                    <a id="dlink" download="{{ExcelName}}.xls" ng-show="false"></a>
                </div>
            </div>
        </div>

        <div class="panel-body">
            <table id="Excel_table" class="table table-striped table-bordered dataTable table-condensed tree_table" style="table-layout:fixed">
                <thead>
                    <tr>
                        <th class="col-md-1 text-center">日期</th>
                        <th class="col-md-1 text-center">商品名称</th>
                        <th class="col-md-1 text-center">交易类型</th>
                        <th class="col-md-1 text-center">消费金额</th>
                        <th class="col-md-1 text-center">充值金额</th>
                        <th class="col-md-1 text-center">退款金额</th>
                        <th class="col-md-1 text-center">商品数量</th>
                        <th class="col-md-1 text-center">订单数</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="item in statisticsList" ng-show="statisticsList.length > 1">
                        <td class="text-center" ng-if="$index == statisticsList.length - 1">{{item.sale_name}}</td>
                        <td class="text-center" ng-if="$index == statisticsList.length - 1">{{item.create_time}}</td>
                        <td class="text-center" ng-if="$index != statisticsList.length - 1">{{item.create_time}}</td>
                        <td class="text-center" ng-if="$index != statisticsList.length - 1">{{item.sale_name}}</td>
                        <td class="text-center" ng-if="$index == statisticsList.length - 1">{{item.type}}</td>
                        <td class="text-center" ng-if="$index != statisticsList.length - 1">{{item.type == '1'? '消费': '充值'}}</td>
                        <td class="text-center">{{item.spend}}</td>
                        <td class="text-center">{{item.adds? item.adds: '-'}}</td>
                        <td class="text-center">{{item.back? item.back: '-'}}</td>
                        <td class="text-center">{{item.num}}</td>
                        <td class="text-center">{{item.order_num}}</td>
                    </tr>
                    <tr ng-if="statisticsList.length < 2" class="text-center">
                        <td colspan="7">没有数据</td>
                    </tr>
                </tbody>
            </table>
        </div>

    </div>
</div>